{__NOLAYOUT__}
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__PUBLIC__/bbs/static/common/js/layui/css/layui.css">
  <link rel="stylesheet" href="__PUBLIC__/bbs/static/default/css/global.css">
  <link rel="stylesheet" href="__PUBLIC__/bbs/static/default/css/index.css">
  <link rel="stylesheet" href="__PUBLIC__/bbs/static/common/js/editor/css/simditor.css" />
  <meta charset="UTF-8">
  <title>社区-{$seo_title}</title>
  <include file="Index:meta" />
</head>
<include file="Index:header" />
<body style="margin-top:0px">
<div class="layui-container fly-marginTop">
  <div class="fly-panel" pad20 style="padding-top: 5px;">
    <div class="layui-form layui-form-pane">
      <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
          <li class="layui-this">发表新帖</li>
        </ul>
        <div class="layui-form layui-tab-content" style="padding: 20px 0;">
          <div class="layui-tab-item layui-show">
            <form action="{:U('Home/Bbs/save')}" method="post" id="save">
                <input type="hidden" name="id" value="{$tips.id}">
              <div class="layui-form-item">
                <label class="layui-form-label">标题</label>
                <div class="layui-input-block">
                  <input type="text" name="title" id="title" required lay-verify="required" class="layui-input" value="{$tips.title}">
                </div>
              </div>
              <div class="layui-form-item layui-form-text">
                <div class="layui-input-block">
                  <textarea id="editor" name="content"  lay-verify="required" placeholder="详细描述" class="layui-textarea" autofocus>{$tips.content}</textarea>
                </div>
              </div>
              <div class="layui-form-item" <if condition="$ms neq 1">style="display:none;"</if>>
                <label class="layui-form-label">置顶</label>
                <div class="layui-input-block">
                  <input type="radio" name="is_top" value="0" title="未置顶" checked="checked">
                  <input type="radio" name="is_top" value="1" title="置顶">
                </div>
              </div>
              <div class="layui-form-item" <if condition="$ms neq 1">style="display:none;"</if>>
                <label class="layui-form-label">推荐</label>
                <div class="layui-input-block">
                  <input type="radio" name="is_re" value="0" title="未推荐" checked="checked">
                  <input type="radio" name="is_re" value="1" title="推荐">
                </div>
              </div>
              <div class="layui-form-item">
                <button class="layui-btn submit">
                  <i class="iconfont icon-yijianfankui"></i>
                  <if condition="$tips['id'] neq ''">
                      确认修改
                      <else/>
                      立即发布
                  </if>
                </button>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<!--JS引用-->
<script src="__PUBLIC__/bbs/static/common/js/jquery.min.js"></script>
<script src="__PUBLIC__/bbs/static/common/js/layui/layui.all.js"></script>
<script src="__PUBLIC__/bbs/static/common/js/global.js"></script>
<script type="text/javascript" src="__PUBLIC__/bbs/static/common/js/editor/js/module.js"></script>
<script type="text/javascript" src="__PUBLIC__/bbs/static/common/js/editor/js/hotkeys.js"></script>
<script type="text/javascript" src="__PUBLIC__/bbs/static/common/js/editor/js/uploader.js"></script>
<script type="text/javascript" src="__PUBLIC__/bbs/static/common/js/editor/js/simditor.js"></script>
<script type="text/javascript">
  $(function () {
    var editor = new Simditor({
      textarea: $('#editor'),
      toolbar: ['title', 'bold', 'italic', 'underline', 'strikethrough', 'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|', 'link', 'image', 'hr', '|', 'indent', 'outdent'],
      upload: {
        url: '/api.php/upload/attach.html',
        params: { attach: $("input[name='attach']").val() },
        fileKey: 'file',
        connectionCount: 3,
        leaveConfirm: '正在上传文件',
      }
    });
  })
  $('.submit').on('click',function(){
      var title  = $('#title').val();
      var con = $('#editor').val();
      if(title == ''){
          alert('标题不能为空');
          return false;
      }
      if(con == ''){
          alert('内容不能为空');
          return false;
      }
      $('#save').submit();
  });
</script>
</body>
</html>
<include file="Index:footer"/>